Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
DOM helper library
npm install dom-lib --save
import { addClass } from 'dom-lib';
Class
hasClass: (node: HTMLElement, className: string) => boolean;
addClass: (node: HTMLElement, className: string) => HTMLElement;
removeClass: (node: HTMLElement, className: string) => HTMLElement;
toggleClass: (node: HTMLElement, className: string) => HTMLElement;
Style
getStyle: (node: HTMLElement, property: string) => string;
getStyle: (node: HTMLElement) => Object;
removeStyle: (node: HTMLElement, property: string) => void;
removeStyle: (node: HTMLElement, propertys: Array<string>) => void;
addStyle: (node: HTMLElement, property: string, value: string) => void;
addStyle: (node: HTMLElement, style: Object) => void;
Events
on: (target: HTMLElement, eventName: string, listener: Function, capture: boolean = false) => {
off: Function;
};
off: (target: HTMLElement, eventName: string, listener: Function, capture: boolean = false) =>
void;
Query
activeElement: () => HTMLElement;
getHeight: (node: HTMLElement, client: HTMLElement) => number;
getWidth: (node: HTMLElement, client: HTMLElement) => number;
getOffset: (node: HTMLElement) => Object;
getOffsetParent: (node: HTMLElement) => Object;
getPosition: (node: HTMLElement, offsetParent) => Object;
getWindow: (node: HTMLElement) => String;
nodeName: (node: HTMLElement) => String;
ownerDocument: (node: HTMLElement) => Object;
ownerWindow: (node: HTMLElement) => Object;
contains: (context: HTMLElement, node: HTMLElement) => boolean;
scrollLeft: (node: HTMLElement) => number;
scrollTop: (node: HTMLElement) => number;
Utils
scrollLeft: (node: HTMLElement, val: number) => void;
scrollTop: (node: HTMLElement, val: number) => void;
FAQs
DOM helper library
The npm package dom-lib receives a total of 58,597 weekly downloads. As such, dom-lib popularity was classified as popular.
We found that dom-lib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.